#ifndef _COMM_RTL_H_
#define _COMM_RTL_H_

#include "IDebugPrint.h"
#include "IHash.h"
#include "IStringProcesser.h"
#include "ISharedMem.h"
#include "IStringVectorW.h"
#include "IPipeServer.h"
#include "IPipeClient.h"
#include "IProcessTool.h"
#include "IDrivePath.h"
#include "INameValueSetInMem.h"
#include "IStringVectorInMem.h"
#include "IROTEventReport.h"
#include "IKeyPointerMap.h"
#include "IVolumeFormat.h"
#include "IDriveLetterList.h"
#include "ICmdLine.h"
#include "IServiceUtil.h"
#include "IRegUtil.h"
#include "IFontEnum.h"
#include "IEvent.h"
#include "IBitmpFile.h"
#include "IBitmapWindow.h"
#include "ITextFloatWindow.h"
#include "ICipher.h"
#include "IRand.h"
#include "IDlgInputPwd.h"
#include "IDataStream.h"
#include "ISysUtil.h"
#include "IStringVectorA.h"
#include "ISoftList.h"
#include "IObjectVector.h"
#include "IPointerVector.h"
#include "IWndEnum.h"
#include "IUdpClient.h"
#include "IUdpServer.h"
#include "IFileEnum.h"
#include "IPESigVerify.h"
#include "ITimer.h"
#include "IProcessEnum.h"
#include "IPEVersion.h"

#define   COMMRTL_SUCCESS                  0
#define   COMMRTL_INVALID_PARAMETER        1
#define   COMMRTL_LOAD_MOD_FAILED          2
#define   COMMRTL_NOT_FOUND                3
#define   COMMRTL_CREATE_DLG_FAIL          4
#define   COMMRTL_CANCEL                   5
#define   COMMRTL_NO_MEMORY                6
#define   COMMRTL_CREATE_SNAPSHOT_FAILED   7
#define   COMMRTL_OPEN_PIPE_FAILED         8
#define   COMMRTL_NOT_IMPLEMENTED          9
#define   COMMRTL_OPEN_FILE_FAILED         10

#define   IID_DEBUG_PRINT                  0
#define   CLSID_DEBUG_PRINT                0
#define   CLSID_DEBUG_PRINT_DUMMY          1


#define   IID_HASH                         1
#define   CLSID_HASH_MD5                   0
#define   CLSID_HASH_CRC32                 1


#define   IID_STRING_PROCESSER             2
#define   CLSID_STRING_PROCESSER           0

#define   IID_SHARED_MEMO                  3
#define   CLSID_SHARED_MEM                 0

#define   IID_STRING_VECTOR_W              4
#define   CLSID_STRING_VECTOR_W            0

#define   IID_PIPE_SERVER                  5
#define   CLSID_PIPE_SERVER                0

#define   IID_PIPE_CLIENT                  6
#define   CLSID_PIPE_CLIENT                0

#define   IID_PROCESS_TOOL                 7
#define   CLSID_PROCESS_TOOL               0

#define   IID_DRIVE_INFO                   8
#define   CLSID_DRIVE_INFO                 0

#define   IID_NAME_VALUE_SET_IN_MEM             9
#define   CLSID_NAME_VALUE_SET_IN_MEM           0

#define   IID_STRING_VECTOR_IN_MEM             10
#define   CLSID_STRING_VECTOR_IN_MEM           0

#define   IID_ROT_EVENT_REPORT                11
#define   CLSID_ROT_EVENT_REPORT               0

#define   IID_KEY_POINTER_MAP                 12
#define   CLSID_KEY_POINTER_MAP                0

#define   IID_VOLUME_FORMAT                   13
#define   CLSID_VOLUME_FORMAT                  0

#define   IID_DRIVE_LETTER_LIST                   14
#define   CLSID_DRIVE_LETTER_LIST                  0

#define   IID_CMD_LINE                           15
#define   CLSID_CMD_LINE                         0

#define   IID_SERVICE_UTIL                       16
#define   CLSID_SERVICE_UTIL                     0

#define   IID_REG_UTIL                           17
#define   CLSID_REG_UTIL                         0

#define   IID_FONT_ENUM                          18
#define   CLSID_FONT_ENUM                        0

#define   IID_EVENT                              19
#define   CLSID_EVENT                            0

#define   IID_DISK                               20
#define   CLSID_DISK                             0

#define   IID_BITMAP_FILE                        21
#define   CLSID_BITMAP_FILE                      0

#define   IID_BITMAP_WINDOW                      22
#define   CLSID_BITMAP_WINDOW                    0

#define   IID_TEXT_FLOAT_WINDOW                  23
#define   CLSID_TEXT_FLOAT_WINDOW                0

#define   IID_CIPHER                             24
#define   CLSID_CIPHER_AES                       0

#define   IID_RAND                               25
#define   CLSID_RAND_LIBC                        0

#define   IID_DLG_INPUT_PWD                      26
#define   CLSID_DLG_INPUT_PWD_SIMPLE              0
#define   CLSID_DLG_INPUT_PWD_CFM                 1

#define   IID_STRING_VECTOR_A                    27
#define   CLSID_STRING_VECTOR_A                  0

#define   IID_SYS_UTIL                           28
#define   CLSID_SYS_UTIL                         0

#define   IID_SOFT_LIST                         29
#define   CLSID_SOFT_LIST                       0

#define   IID_OBJECT_VECTOR                     30
#define   CLSID_OBJECT_VECTOR                   0

#define   IID_POINTER_VECTOR                     31
#define   CLSID_POINTER_VECTOR                   0

#define   IID_WND_ENUM                          32
#define   CLSID_WND_ENUM                        0


#define   IID_UDP_SERVER                         33
#define   CLSID_UDP_SERVER                       0

#define   IID_UDP_CLIENT                         34
#define   CLSID_UDP_CLIENT                       0

#define   IID_KEY_OBJECT_MAP                     35
#define   CLSID_KEY_OBJECT_MAP                   0

#define   IID_FILE_ENUM                          36
#define   CLSID_FILE_ENUM                        0

#define   IID_PE_SIG_VERIFY                      37
#define   CLSID_PE_SIG_VERIFY                    0

#define   IID_PE_VERSION                         38
#define   CLSID_PE_VERSION                       0

//
//IDebugPrint*  DebugPrint;
//CommRtl_CreateObject(0,0, &DebugPrint);
//
DWORD  CommRtl_CreateObject(DWORD  dwIID, DWORD dwClsID, PVOID*  ppObject);


#ifndef Add2Ptr
#define Add2Ptr(P,I) ((PVOID)((PUCHAR)(P) + (I)))
#endif


VOID  DebugPrintA(const char* format, ...);
VOID  DebugPrintW(const wchar_t* format, ...);

#if _DEBUG

#define PRINT_A(_x_) DebugPrintA _x_
#define PRINT_W(_x_) DebugPrintW _x_

#else

#define PRINT_A(_x_) 
#define PRINT_W(_x_)  

#endif 

#endif
